<!doctype html>
<html lang="zn-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <style>
        div{
            width:50px;
            height:50px;
            float: left;
            background-color: #c09f7a;
            /*border:1px solid darkred;*/
            margin-right:10px;
        }
    </style>
</head>
<body>
    <!--<p>hello</p>-->
    <!--<button id="btn">hide</button>-->
    <!--<button id="btn2">show</button>-->
    <!--<button id="btn3">toggle</button>-->
    <!--<script src="js/demo1.js"></script>-->
    <script>
        for(var i = 0;i<5; i++){
            $("<div>").appendTo(document.body);
        }
        $("div").on("click",function () {
            $(this).hide(2000,function (){
                $(this.remove());
            });
        })
    </script>
</body>
</html>